home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / fortran / libry51.zip / LIBRY6A.DOC < prev    next >
Text File  |  1989-11-10  |  2KB  |  68 lines

  1. .de
  2. .pa
  3.                      EXAMPLE PROGRAM USING PLOT ROUTINES
  4.  
  5.  
  6. $STORAGE:2
  7.       PROGRAM PLOT
  8. C
  9. C  this program illustrates how to use the plot subroutines
  10. C
  11.       IMPLICIT INTEGER*2(I-N),REAL*4(A-H,O-Z)
  12.       DIMENSION IXBOX(4),IYBOX(4)
  13.       DATA LU,IOPT/8086,0/
  14.       DATA IXBOX/245,245,315,315/
  15.       DATA IYBOX/ 45,115,115, 45/
  16. C
  17. C  begin plot
  18. C
  19.       CALL START(LU,IOPT)
  20. C
  21. C  put a large label at the top of the CRT
  22. C                                      12345678901234567
  23.       CALL SYMBS(24,180,16,1.,0.,0.,0,'THIS IS THE TITLE',17,LU)
  24. C
  25. C  put a smaller label at the bottom of the CRT
  26. C                                    123456789012345678901234
  27.       CALL SYMBS(12,6,12,1.,0.,0.,0,'this could be the legend',24,LU)
  28. C
  29. C  draw a 3-leaf rose in the middle of the CRT in 3 colors
  30. C
  31.       IX2=160
  32.       IY2=120
  33.       DO 100 IDEGREES=1,180
  34.       RADIANS=FLOAT(IDEGREES)/57.2957795
  35.       R=80.*SIN(3.*RADIANS)
  36.       X=R*COS(RADIANS)
  37.       Y=R*SIN(RADIANS)
  38.       IX1=IX2
  39.       IY1=IY2
  40.       IX2=160+NINT(X)
  41.       IY2=120+NINT(Y)
  42.       ICOLOR=1
  43.       IF(IDEGREES.GT. 60) ICOLOR=2
  44.       IF(IDEGREES.GT.120) ICOLOR=3
  45.       CALL COLOR(ICOLOR,LU,0)
  46.   100 CALL LINE0(IX1,IY1,IX2,IY2,2,LU)
  47. C
  48. C  draw a circle with a box around it
  49. C
  50.       CALL COLOR(1,LU,0)
  51.       CALL CIRCL(40,80,30,0,360,LU)
  52. C
  53.       CALL COLOR(2,LU,0)
  54.       CALL BOX(5,45,75,115,LU)
  55. C
  56. C  draw a box, outline it, and fill it in solid
  57. C
  58.       CALL COLOR(3,LU,0)
  59.       CALL PATRN(IXBOX,IYBOX,4,0.,-1,2,LU)
  60. C
  61. C  terminate plot
  62. C
  63.       CALL QUITS(LU,IOPT)
  64. C
  65.       STOP
  66.       END
  67. .de
  68.